package cn.hanyx.vlog.articleservice.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;

/**
 * AppConfig
 *
 * @author CSS
 * @date 2021/11/12
 */
@Configuration
//通知Spring,这个类中的属性对nacos配置进行监听
//一旦nacos重新发布新的属性值则自动创建一个新的AppConfig对象替换旧对象实现自动更新
@RefreshScope
public class AppConfig {

    @Value("${app.secretKey}")
    private String appKey;

    public String getAppKey() {
        return appKey;
    }

    public void setAppKey(String appKey) {
        this.appKey = appKey;
    }
}
